home *** CD-ROM | disk | FTP | other *** search
- property mySprite, myRect, myLoc, lastRoll, myType, HLinesList, VLine, targetSprite
-
- on beginSprite me
- global gActorListMan
- mySprite = me.spriteNum
- myRect = rect(93, 546, 257, 592)
- setUpRegions(me)
- myType = #IntWallClickTracker
- registerSprite(gActorListMan, mySprite)
- end
-
- on endSprite me
- global gActorListMan
- unRegisterSprite(gActorListMan, mySprite)
- end
-
- on stepFrame me
- global gCursorMan, gClickSprite
- if voidp(targetSprite) then
- targetSprite = sendAllSprites(#sendSpriteNum, #FloorPlanDisplay)
- end if
- thisRoll = rollover()
- if thisRoll = mySprite then
- setCursor(gCursorMan, #handNormal, myType)
- if (lastRoll <> mySprite) and not (the mouseDown) then
- lastRoll = mySprite
- exit
- end if
- if (gClickSprite = mySprite) and the mouseDown then
- lastRoll = me.mySprite
- setCursor(gCursorMan, #handNormal, myType)
- exit
- end if
- else
- if lastRoll = mySprite then
- lastRoll = 0
- setCursor(gCursorMan, #Arrow, myType)
- end if
- end if
- end
-
- on mouseDown me
- global gClickSprite
- if resWindowUp() or modalWindowUp() then
- exit
- end if
- gClickSprite = mySprite
- if voidp(targetSprite) then
- targetSprite = sendAllSprites(#sendSpriteNum, #FloorPlanDisplay)
- end if
- clickLoc = the clickLoc
- ClickV = clickLoc[2]
- if ClickV > VLine then
- Row = 4
- else
- Row = 0
- end if
- ClickH = clickLoc[1]
- if ClickH < HLinesList[1] then
- column = 1
- else
- if ClickH < HLinesList[2] then
- column = 2
- else
- if ClickH < HLinesList[3] then
- column = 3
- else
- column = 4
- end if
- end if
- end if
- whichAction = column + Row
- put whichAction
- doButtonUpClick(myType, 1)
- sendSprite(targetSprite, #setDisplay, whichAction)
- end
-
- on setUpRegions me
- myHeight = myRect[4] - myRect[2]
- VLine = myRect[2] + (myHeight / 2)
- HLinesList = []
- myWidth = myRect[3] - myRect[1]
- inc = myWidth / 4
- append(HLinesList, myRect[1] + inc)
- append(HLinesList, myRect[1] + (inc * 2))
- append(HLinesList, myRect[1] + (inc * 3))
- end
-